##############################################################################
# Root CMakeLists.txt                                                        #
#                                                                            #
# Authors:  wanshijie@126.com                                                #
#                                                                            #
##############################################################################
cmake_minimum_required(VERSION 3.1)

project (kconfig-frontend)



set(CURSES_NEED_NCURSES TRUE)
find_package(Curses REQUIRED)

if (CURSES_HAVE_CURSES_H)
   add_definitions(-DHAVE_CURSES_H=1)
endif ()
if (CURSES_HAVE_NCURSES_H)
   add_definitions(-DHAVE_NCURSES_H=1)
endif ()
if (CURSES_HAVE_NCURSES_CURSES_H)
   add_definitions(-DHAVE_NCURSES_CURSES_H=1)
endif ()
if (CURSES_HAVE_NCURSES_NCURSES_H)
   add_definitions(-DHAVE_NCURSES_NCURSES_H=1)
endif ()

add_definitions(
-Wno-format-security
)
add_definitions(-DKBUILD_NO_NLS=1)

include_directories(
   "${PROJECT_SOURCE_DIR}/lxdialog"
   ${CURSES_INCLUDE_DIR}
)
add_subdirectory(lxdialog)

add_library(zconf zconf.tab.c)

add_executable(kconfig-mconf mconf.c)
add_executable(kconfig-conf conf.c)

target_link_libraries(kconfig-mconf lxdialog ${CURSES_LIBRARIES} zconf)
target_link_libraries(kconfig-conf ${CURSES_LIBRARIES} zconf)
